package com.zs.blog.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Title: User
 * @Author zs
 * @Package com.zs.blog.model.entity
 * @Date 2024/10/11 23:48
 * @description: 用户表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("um_user")
public class User {

    public Long id;

    @Pattern(regexp = "^\\S{5,16}$")
    @NotEmpty
    public String username;

    @Pattern(regexp = "^\\S{5,16}$")
    @JsonIgnore
    @NotEmpty
    public String password;

    @Pattern(regexp = "^1[3-9]\\d(9)$")
    public String mobilePhone;

    @Email
    public String email;

    public Integer isDisabled;
    public Integer type;
    public Integer isDeleted;
    public String avatar;
    public Integer gender;
    public String introduction;
    public LocalDateTime createTime;
    public LocalDateTime updateTime;
}
